import AxiosHttp from './request'
import { type InternalAxiosRequestConfig } from 'axios'

const axiosHttp = new AxiosHttp({
  baseURL: 'http://123.207.32.32:8000',
  timeout: 5000,
  showLoading: true,
  interceptors: {
    requestInterceptor: (config) => {
      console.log('初始配置-请求拦截器-成功')
      return config as InternalAxiosRequestConfig
    },
    requestInterceptorCatch: (error) => {
      console.log('初始配置-请求拦截器-失败')
      return error
    },
    responseInterceptor: (response) => {
      console.log('初始配置-响应拦截器-成功')
      return response
    },
    responseInterceptorCatch: (error) => {
      console.log('初始配置-响应拦截器-失败')
      return error
    }
  }
})

export default axiosHttp